// run: $exec < input 
#include <stdio.h>
#include <algorithm>
#include <string.h>
struct point{
	int x, y;
};
int ans[50][50];
int xmult(point p1, point p2, point p0)
{
	return (p1.x-p0.x)*(p2.y-p0.y) - (p2.x-p0.x)*(p1.y-p0.y);
}
point p1, p2, p3;
int check(point p1, point p2, point p3, point p0)
{
	int x1, x2, x3;
	x1 = xmult(p1, p0, p2);
	x2 = xmult(p2, p0, p3);
	x3 = xmult(p3, p0, p1);
	return x1>0 && x2>0 && x3>0;
}
void print(int x, int y, int newLine)
{
	printf("(%2d, %2d)%c", x, y, newLine?'\n':' ');
}
int main()
{
	printf("Program 4 by team X\n");
	while(scanf("%d%d%d%d%d%d", &p1.x, &p1.y, &p2.x, &p2.y, &p3.x, &p3.y) != EOF){
		point p0;
		memset(ans, 0, sizeof(ans));
		int mix = 10;
		for(int i=-9; i<=9; i++){
			for(int j=-9; j<=9; j++) {
				p0.x = i; p0.y = j;
				if(check(p1, p2, p3, p0)){
					ans[i+9][j+9] = 1;
					mix = std::min(mix, i);
				}
			}
		}
		for(int j=9; j>=-9; j--){
			int flag = 0;
			for(int i=mix; i<=9; i++){
				if(ans[i+9][j+9]){
					flag = 1;
					break;
				}
			}
			if(flag == 0)
				continue;
			for(int i=mix; i<=9; i++) {
				if(ans[i+9][j+9]){
					int newLine = 0;
					if(ans[i+1+9][j+9] == 0)
						newLine = 1;
					print(i, j, newLine);
					if(newLine)
						break;
				} else {
				for(int k=0; k<9; k++)
						printf(" ");
				}
			}
		}
		printf("\n");
	}
	printf("End of program 4 by team X\n");
	return 0;
}
